//
//  NormalWebViewController.m
//  yydz
//
//  Created by oceans on 2018/8/25.
//  Copyright © 2018年 oceans. All rights reserved.
//

#import "NormalWebViewController.h"

@interface NormalWebViewController ()

@end

@implementation NormalWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    if (_url) {
        NSURL *url = [NSURL URLWithString:_url];
        [self.webView loadRequest:[NSURLRequest requestWithURL:url]];
    }
}

- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
    
    [super webView:webView didFinishNavigation:navigation];
    
    __weak typeof(self) weakself = self;
    [self.webView evaluateJavaScript:@"document.title" completionHandler:^(id _Nullable data, NSError * _Nullable error) {
        weakself.navigationItem.title = data;
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

@end
